home *** CD-ROM | disk | FTP | other *** search
- /***********************************************
- システムスプライトローダ
- Copyright(C) 1993 Okome
- ***********************************************/
-
- #include <stdio.h>
- #include <string.h>
- #include <EGB.h>
- #include <normlib.h>
-
- int sprload( char *na, int xa, int ya )
- {
- int i, xb, yb, xs, ys, l;
- char da[1024];
- FILE *fp;
-
- if ((fp = fopen( na, "rb" ))==NULL)
- return (-1);
- fread( da, 1, 16, fp );
- if (strcmp(da, "SPRITE")==0)
- {
- xs = WORD(da + 10);
- ys = WORD(da + 12);
- l = WORD(da + 14);
- for ( i = 0; i < l; i++ )
- {
- xb = i % 8;
- yb = i / 8;
- fread( da, 1, xs*ys*2+2, fp );
- egbput( xa+xs*xb, ya+ys*yb,
- xa+xs*(xb+1)-1, ya+ys*(yb+1)-1, &da[2] );
- }
- }
- fclose(fp);
- return (0);
- }
-